package com.sinosoft.generateDataInfo.common.xmlService;

import java.io.File;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;


public abstract class XmlReaderDom4j {

	@SuppressWarnings("unchecked")
	public static List<Element> readerXMLFileByXpathReturnElements(File f,String xpath) throws DocumentException {
		SAXReader reader = new SAXReader();
		Document doc = reader.read(f);
		Element root = doc.getRootElement();
		return root.selectNodes(xpath);
	}
}
